<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('选择员工')"/>
    <th:block th:include="include :: layout-latest-css"/>
    <th:block th:include="include :: ztree-css"/>
    <th:block th:include="include :: select2-css"/>
</head>
<style>
    #dqxz{
       text-align: left !important;
        color: #1890FF;
    }
</style>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <input type="hidden" id="eid" name="eid">
                <div class="select-list">
                    <ul>
                        <li>
                            <p>工号：</p>
                            <input type="text" name="badge"/>
                        </li>
                        <li>
                            <p>姓名：</p>
                            <input type="text" name="name"/>
                        </li>

                        <li>
                            <p>当前选中：</p>
                            <p id="dqxz"></p>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>


        <div class="btn-group-sm" id="toolbar" role="group">

        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: layout-latest-js"/>
<th:block th:include="include :: ztree-js"/>
<th:block th:include="include :: bootstrap-table-editable-js"/>

<script th:inline="javascript">
    var prefix = ctx + 'personStatisticsAnalysis/empResume';
    $(function () {
        queryData();
        $("#bootstrap-table").on("check.bs.table", function () {         //点击radio触发事件
            var row = $("#bootstrap-table").bootstrapTable('getSelections');
            document.getElementById('dqxz').innerHTML = row[0].name;
            $("#eid").val(row[0].eid);
        });
    })


    function queryData() {
        var columns = [];
        var badge = {field: 'badge', title: '工号'};
        var name = {field: 'name', title: '姓名'};
        var radio = {radio: true};
        columns.push(radio, badge, name);

        var options = {
            code: "eid",
            uniqueId: "eid",
            url: prefix + '/findEmp',
            modalName: "选择员工",
            height: $(window).height() - 110,
            columns: columns,
        };
        $.table.init(options);

    }


</script>
</body>
</html>